<?php
$folder_str_all= dirname( __FILE__ );  
$template_directory= str_replace("\\", "/", $folder_str_all);
$find= "/wp-content/themes/";
$pos= strpos($template_directory, $find);
define("FOLDER_STR", substr($template_directory, $pos+strlen($find)));

session_start();
require_once(ABSPATH . 'wp-admin/includes/user.php');
require_once(ABSPATH . WPINC . '/registration.php');
require_once dirname( __FILE__ ) . '/functions-clientuser.php';

// REGISTER
if($_GET['action']=="register")
{
	require_once dirname( __FILE__ ) . '/register.php';
	exit;

}
// LOGIN
if($_GET['action']=="sigin")
{
	require_once dirname( __FILE__ ) . '/process-login.php';
}
// LOGOUT
if($_GET['action']=="ulogout")
{
	wp_logout();
	session_unset();
	session_destroy();	
	wp_redirect( get_bloginfo( 'url' ) . "/" );
}
?>
<!-- hearder -->
<?php get_header() ?>
<div id="content">
	<div class="left">
		<!-- search -->            
	       <?php include (TEMPLATEPATH . '/searchform.php'); ?>          
              <div  class="tabcontainer" >				
			<?if (have_posts()):?>
				<? while(have_posts()):?>
    			<? the_post()?>
				
				<div class="question">
        		<div class="question-title">			 
				
            		<div class="question-user-img">
                		<img src="<?php echo get_bloginfo('template_directory'); ?>/images/question-img.jpg" />
                	</div>
                	<div class="question-by">
                		<p><?php the_author_posts_link();?></p>
                    	<p class="question-h1"><a href='<?=the_permalink()?>'><?=the_title()?></a></p>
                	</div>
                			<div style="clear:both;"></div>
				
            	</div>
            <div class="question-bottom">
            	<div class="answer">
                	<a href=<?php comment_link()?>>Answer this question</a>
                	
                </div>
                <div class="answers">                
                	<p><font class="answer-nr"><a href=<?php comment_link();?>><?php comments_number("No Answer", "1 Answer", "% Answers");?> </a></font></p>					
                </div>
                <div class="answer-date">
                	<p><?php the_time(get_option('date_format'));?></p>
                </div>
                <div class="tags">
                	<p>&laquo;&raquo;</p>
                    <ul>
                    	<li><a href="#"><?php if(get_the_tags()) the_tags('', ', ', '');
                    	else echo "None";
                    	?></a></li>                        
                    </ul>
                </div>
			</div>
         </div>		                 
    			   	
			<?endwhile;?>
		<?endif;?>   
			
			</div><!-- close tabcontainer  -->              	                               
    </div>
	<!-- sidebar -->
	<?php get_sidebar(); ?>
</div>      
<!-- footer -->	    
<?php get_footer(); ?>		
    

